import { alova } from '@/service/request';

/** get Article page */
export function paginateArticle(params?: Api.SearchParams) {
  return alova.Get<Api.PageRow>('/cms/article/paginate', {
    params
  });
}

/** get all Article */
export function listArticle() {
  return alova.Get<Api.Row[]>('/cms/article/list');
}

/** create Article */
export function createArticle(data?: Api.Model) {
  return alova.Post<boolean>('/cms/article/create', data);
}

/** update Article */
export function updateArticle(data?: Api.Model) {
  return alova.Post<boolean>('/cms/article/update', data);
}

/** delete Article */
export function deleteArticle(params: Api.DeleteParams) {
  return alova.Post<boolean>('/cms/article/delete', undefined, { params });
}

/** delete Article */
export function batchDelArticle(params: Api.BatchDeleteParams) {
  return alova.Post<boolean>('/cms/article/batchDel', undefined, { params });
}
